﻿<controls:AbstractRefreshingControl
    x:Class="LenovoLegionToolkit.WPF.Controls.KeyboardBacklight.RGB.RGBKeyboardBacklightControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:LenovoLegionToolkit.WPF.Controls"
    xmlns:lib="clr-namespace:LenovoLegionToolkit.Lib;assembly=LenovoLegionToolkit.Lib"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:rgb="clr-namespace:LenovoLegionToolkit.WPF.Controls.KeyboardBacklight.RGB"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" SharedSizeGroup="A" />
            <ColumnDefinition Width="*" SharedSizeGroup="A" />
            <ColumnDefinition Width="*" SharedSizeGroup="A" />
            <ColumnDefinition Width="*" SharedSizeGroup="A" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />

            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />

            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <wpfui:InfoBar
            x:Name="_vantageWarningInfoBar"
            Title="{x:Static resources:Resource.Keyboard_VantageEnabledWarning_Title}"
            Grid.Row="0"
            Grid.Column="0"
            Grid.ColumnSpan="4"
            Margin="0,0,8,24"
            IsClosable="False"
            IsOpen="False"
            Message="{x:Static resources:Resource.Keyboard_VantageEnabledWarning_Message}"
            Severity="Error" />

        <wpfui:Button
            x:Name="_offPresetButton"
            Grid.Row="1"
            Grid.Column="0"
            Height="36"
            Margin="0,0,8,24"
            HorizontalAlignment="Stretch"
            Click="PresetButton_Click"
            Content="{x:Static resources:Resource.RGBKeyboardBacklightControl_PresetOff}"
            Tag="{x:Static lib:RGBKeyboardBacklightPreset.Off}" />
        <wpfui:Button
            x:Name="_preset1Button"
            Grid.Row="1"
            Grid.Column="1"
            Height="36"
            Margin="0,0,8,24"
            HorizontalAlignment="Stretch"
            Click="PresetButton_Click"
            Content="{x:Static resources:Resource.RGBKeyboardBacklightControl_Preset1}"
            Tag="{x:Static lib:RGBKeyboardBacklightPreset.One}" />
        <wpfui:Button
            x:Name="_preset2Button"
            Grid.Row="1"
            Grid.Column="2"
            Height="36"
            Margin="0,0,8,24"
            HorizontalAlignment="Stretch"
            Click="PresetButton_Click"
            Content="{x:Static resources:Resource.RGBKeyboardBacklightControl_Preset2}"
            Tag="{x:Static lib:RGBKeyboardBacklightPreset.Two}" />
        <wpfui:Button
            x:Name="_preset3Button"
            Grid.Row="1"
            Grid.Column="3"
            Height="36"
            Margin="0,0,8,24"
            HorizontalAlignment="Stretch"
            Click="PresetButton_Click"
            Content="{x:Static resources:Resource.RGBKeyboardBacklightControl_Preset3}"
            Tag="{x:Static lib:RGBKeyboardBacklightPreset.Three}" />

        <rgb:RGBKeyboardBacklightBrightnessCardControl
            x:Name="_brightnessControl"
            Grid.Row="2"
            Grid.Column="0"
            Grid.ColumnSpan="4"
            Margin="0,0,8,0"
            OnChanged="CardControl_Changed" />
        <rgb:RGBKeyboardBacklightEffectCardControl
            x:Name="_effectControl"
            Grid.Row="3"
            Grid.Column="0"
            Grid.ColumnSpan="4"
            Margin="0,0,8,0"
            OnChanged="CardControl_Changed" />
        <rgb:RGBKeyboardBacklightSpeedCardControl
            x:Name="_speedControl"
            Grid.Row="4"
            Grid.Column="0"
            Grid.ColumnSpan="4"
            Margin="0,0,8,0"
            OnChanged="CardControl_Changed" />

        <wpfui:CardControl
            x:Name="_zone1Control"
            Grid.Row="5"
            Grid.Column="0"
            Margin="0,0,8,8"
            VerticalAlignment="Top"
            Icon="Color24">
            <wpfui:CardControl.Header>
                <controls:CardHeaderControl Title="{x:Static resources:Resource.RGBKeyboardBacklightControl_Zone1}" />
            </wpfui:CardControl.Header>
            <wpfui:CardControl.ContextMenu>
                <ContextMenu>
                    <!--  ReSharper disable once Xaml.RedundantResource  -->
                    <wpfui:MenuItem
                        Click="SynchroniseZonesMenuItem_Click"
                        Header="Synchronise zones"
                        SymbolIcon="ArrowsBidirectional24" />
                </ContextMenu>
            </wpfui:CardControl.ContextMenu>
            <controls:ColorPickerControl x:Name="_zone1ColorPicker" ColorChangedDelayed="CardControl_Changed" />
        </wpfui:CardControl>

        <wpfui:CardControl
            x:Name="_zone2Control"
            Grid.Row="5"
            Grid.Column="1"
            Margin="0,0,8,8"
            VerticalAlignment="Top"
            Icon="Color24">
            <wpfui:CardControl.Header>
                <controls:CardHeaderControl Title="{x:Static resources:Resource.RGBKeyboardBacklightControl_Zone2}" />
            </wpfui:CardControl.Header>
            <wpfui:CardControl.ContextMenu>
                <ContextMenu>
                    <!--  ReSharper disable once Xaml.RedundantResource  -->
                    <wpfui:MenuItem
                        Click="SynchroniseZonesMenuItem_Click"
                        Header="Synchronise zones"
                        SymbolIcon="ArrowsBidirectional24" />
                </ContextMenu>
            </wpfui:CardControl.ContextMenu>
            <controls:ColorPickerControl x:Name="_zone2ColorPicker" ColorChangedDelayed="CardControl_Changed" />
        </wpfui:CardControl>

        <wpfui:CardControl
            x:Name="_zone3Control"
            Grid.Row="5"
            Grid.Column="2"
            Margin="0,0,8,8"
            VerticalAlignment="Top"
            Icon="Color24">
            <wpfui:CardControl.Header>
                <controls:CardHeaderControl Title="{x:Static resources:Resource.RGBKeyboardBacklightControl_Zone3}" />
            </wpfui:CardControl.Header>
            <wpfui:CardControl.ContextMenu>
                <ContextMenu>
                    <!--  ReSharper disable once Xaml.RedundantResource  -->
                    <wpfui:MenuItem
                        Click="SynchroniseZonesMenuItem_Click"
                        Header="Synchronise zones"
                        SymbolIcon="ArrowsBidirectional24" />
                </ContextMenu>
            </wpfui:CardControl.ContextMenu>
            <controls:ColorPickerControl x:Name="_zone3ColorPicker" ColorChangedDelayed="CardControl_Changed" />
        </wpfui:CardControl>

        <wpfui:CardControl
            x:Name="_zone4Control"
            Grid.Row="5"
            Grid.Column="3"
            Margin="0,0,8,8"
            VerticalAlignment="Top"
            Icon="Color24">
            <wpfui:CardControl.Header>
                <controls:CardHeaderControl Title="{x:Static resources:Resource.RGBKeyboardBacklightControl_Zone4}" />
            </wpfui:CardControl.Header>
            <wpfui:CardControl.ContextMenu>
                <ContextMenu>
                    <!--  ReSharper disable once Xaml.RedundantResource  -->
                    <wpfui:MenuItem
                        Click="SynchroniseZonesMenuItem_Click"
                        Header="Synchronise zones"
                        SymbolIcon="ArrowsBidirectional24" />
                </ContextMenu>
            </wpfui:CardControl.ContextMenu>
            <controls:ColorPickerControl x:Name="_zone4ColorPicker" ColorChangedDelayed="CardControl_Changed" />
        </wpfui:CardControl>

    </Grid>

</controls:AbstractRefreshingControl>